using UnityEngine;
using UnityEngine.Events;
public class UniversalOnlyItem : MonoBehaviour
{
    public UnityEvent<PlayerController> SelectBehaviour;

    private void OnTriggerEnter2D(Collider2D collision)
    {
        PlayerController playerController = collision.gameObject.GetComponent<PlayerController>();
        if (playerController != null)
        {
            SelectBehaviour?.Invoke(playerController);
            Destroy(gameObject);
        }

    }
}